package cn.org.donald.framework.config;

import org.apache.ibatis.logging.Log;
import org.springframework.stereotype.Component;

/**
 * Sql logs print on console
 * @author : Donald
 * @since : 2021/1/8 8:31
 */
@Component
public class SqlLogConfig implements Log {

    public SqlLogConfig(String clazz) {
    }

    public SqlLogConfig() {
    }

    @Override
    public boolean isDebugEnabled() {
        return true;
    }

    @Override
    public boolean isTraceEnabled() {
        return true;
    }

    @Override
    public void error(String s, Throwable e) {
        System.err.println(s);
        e.printStackTrace(System.err);
    }

    @Override
    public void error(String s) {
        System.err.println(s);
    }

    @Override
    public void debug(String s) {
        System.out.println(s);
    }

    @Override
    public void trace(String s) {
        System.out.println(s);
    }

    @Override
    public void warn(String s) {
        System.out.println(s);
    }

}
